<?php
namespace app\service;

use think\console\Command;
use think\console\Input;
use think\console\Output;

class RabbitMq extends Command {
    protected function configure() {
        $this
            ->setName('RabbitMq')
            ->setDescription('Here is the RabbitMqService')
            ->addArgument('name');
    }

    /**
     * @param Input $input
     * @param Output $output
     */
    protected function execute(Input $input, Output $output) {
        $output->writeln('开始监听...'.date('Y-m-d H:i:s'));
        $name = $input->getArgument('name');
        action('rabbitmq/MqConsumer/consumer', ['name' => $name]);
    }
}